package org.colafries.common.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author Ann
 * @version v1.0
 * @ClassName AggFunctionEnum
 * @Description
 * @date Created in 2024/6/19
 **/
@Getter
@AllArgsConstructor
public enum AggFunctionEnum {
    SUM("SUM"),
    COUNT("COUNT");

    private final String symbol;

    public static AggFunctionEnum fromSymbol(String symbol) {
        for (AggFunctionEnum operator : values()) {
            if (operator.getSymbol().equalsIgnoreCase(symbol)) {
                return operator;
            }
        }
        throw new IllegalArgumentException("Unknown SQL operator: " + symbol);
    }
}
